<%="<span class=todo_item_label>" + "Avaliable todo items:".t + "</span>" if todo_items.size > 0%>
<%todo_items.each do |i|%>
 <%if params[:uid].to_i > 0%>
  <%next if i.user.nil?%>
  <%next if i.user and params[:uid].to_i != i.user.id%>
 <%end%>
<div id=todo_item_<%=i.id%> onmouseover="Element.show('action_<%=i.id%>')" onmouseout="Element.hide('action_<%=i.id%>')">
<span id="action_<%=i.id%>" style="display:none" class="todo_item_action">
  <%if (not i.todo.project.use_permission  or i.todo.project.use_permission.nil?) or (i.todo.project.use_permission and @cur_user.has_permission?("prj_" + i.todo.project.id.to_s + "_todo_edit"))%>
<%=link_to_remote image_tag("trash.gif",:border=>0),:confirm=>"Are you sure?".t,:url=>{:controller=>'todos',:action=>'delete_todo_item',:id =>i.id},:loading=>"Element.hide('chk_#{i.id}');Element.show('indicator_#{i.id}');new Effect.Highlight('todo_item_#{i.id}');return false"%>
 <%end%>
</span>
<%=image_tag"undo.gif"%>
<span id='chk_<%=i.id%>'><%=check_box_tag "todo_item_id",i.id,false,:onclick=>"new Ajax.Request('/todos/mark_finish/?todo_item_id=#{i.id}',{asynchronous:true, evalScripts:true});Element.show('indicator_#{i.id}');Element.hide('chk_#{i.id}')",:disabled=>(not @cur_user.have_power?(i))%></span>
<%=indicator(i.id)%>
<span class="prior p_<%=(i.prior rescue 4)%>">&nbsp;</span>
<%="<strong>" + i.user.name + ":</strong>" if i.user_id.to_i > 0%>
<%=i.name%>
<% if i.todo.milestone%>
 <span class="intro_txt">
 <%="[" + i.started_at.strftime("%Y/%m/%d") + (i.due_at ? "-" + i.due_at.strftime("%Y/%m/%d"):"-" + "Next day".t) +"]" %>
 </span>
<%end%>
 <!-- todo item comment-->
  <span class="todo_comment_brief">
     <%=link_to_remote image_tag("comments.gif",:border=>0),:url=>{:action=>'index',:controller=>'todo_comments'}%>
  </span>
</div>
<div id="comments_<%=i.id%>" class="todo_comments_content"></div>
<%end%>
